require(oetteR)
require(tidyverse)
## Loading required package: tidyverse
## Loading tidyverse: ggplot2
## Loading tidyverse: tibble
## Loading tidyverse: tidyr
## Loading tidyverse: readr
## Loading tidyverse: purrr
## Loading tidyverse: dplyr
## Conflicts with tidy packages ----------------------------------------------
## filter(): dplyr, stats
## is_null(): purrr, testthat
## lag(): dplyr, stats
## matches(): dplyr, testthat
col_codes = mtcars %>%
f_clean_data() %>%
f_boxcox() %>%
f_plot_color_code_variables()
## [1] "Number of excluded observations: 0"
## Warning: Unknown variables: `null`
ls = f_clean_data(mtcars) %>%
f_boxcox() %>%
f_pca() %>%
f_pca_plot_components()
## [1] "Number of excluded observations: 0"
## Warning: Unknown variables: `null`
## Warning in .f(.x[[i]], ...): argument is not a matrix, returning input
## object
## Warning in .f(.x[[i]], ...): argument is not a matrix, returning input
## object
## Warning in .f(.x[[i]], ...): argument is not a matrix, returning input
## object
## Joining, by = c("row_names", "PC")
ls
f_clean_data(mtcars) %>%
f_boxcox() %>%
f_pca() %>%
f_pca_plot_variance_explained()
## [1] "Number of excluded observations: 0"
## Warning: Unknown variables: `null`
## Warning in .f(.x[[i]], ...): argument is not a matrix, returning input
## object
## Warning in .f(.x[[i]], ...): argument is not a matrix, returning input
## object
## Warning in .f(.x[[i]], ...): argument is not a matrix, returning input
## object
#pipelearner
pl = mtcars %>%
f_clean_data() %>%
.$data %>%
pipelearner::pipelearner(.$data) %>%
pipelearner::learn_models( twidlr::rpart, disp~. ) %>%
pipelearner::learn_models( twidlr::randomForest, disp~. ) %>%
pipelearner::learn_models( twidlr::svm, disp~. ) %>%
pipelearner::learn() %>%
mutate( imp = map2(fit, train, f_model_importance)
, plot = pmap( list(imp, model, models.id, cv_pairs.id, train_p)
, f_model_importance_plot
, variable_color_code = col_codes
, 'pipelearner'
)
)
## [1] "Number of excluded observations: 0"
## Warning: Unknown variables: `null`
## Warning: Unknown or uninitialised column: 'data'.
## Warning: `cross_d()` is deprecated; please use `cross_df()` instead.
## Warning: `cross_d()` is deprecated; please use `cross_df()` instead.
## Warning: `cross_d()` is deprecated; please use `cross_df()` instead.
## Warning: `cross_d()` is deprecated; please use `cross_df()` instead.
## Warning: `cross_d()` is deprecated; please use `cross_df()` instead.
## Warning: `cross_d()` is deprecated; please use `cross_df()` instead.
## Warning in if (class(M) == "model") {: the condition has length > 1 and
## only the first element will be used
## Warning in if (class(M) == "model") Y = predict(M, data[(1:L), ]) else Y =
## PRED(M, : the condition has length > 1 and only the first element will be
## used
## Warning in if (class(M) == "model") Y = predict(M, data[(1:L), ]) else Y =
## PRED(M, : the condition has length > 1 and only the first element will be
## used
## Warning in if (class(M) == "model") Y = predict(M, data[(1:L), ]) else Y =
## PRED(M, : the condition has length > 1 and only the first element will be
## used
## Warning in if (class(M) == "model") Y = predict(M, data[(1:L), ]) else Y =
## PRED(M, : the condition has length > 1 and only the first element will be
## used
## Warning in if (class(M) == "model") Y = predict(M, data[(1:L), ]) else Y =
## PRED(M, : the condition has length > 1 and only the first element will be
## used
## Warning in if (class(M) == "model") Y = predict(M, data[(1:L), ]) else Y =
## PRED(M, : the condition has length > 1 and only the first element will be
## used
## Warning in if (class(M) == "model") Y = predict(M, data[(1:L), ]) else Y =
## PRED(M, : the condition has length > 1 and only the first element will be
## used
## Warning in if (class(M) == "model") Y = predict(M, data[(1:L), ]) else Y =
## PRED(M, : the condition has length > 1 and only the first element will be
## used
## Warning in if (class(M) == "model") Y = predict(M, data[(1:L), ]) else Y =
## PRED(M, : the condition has length > 1 and only the first element will be
## used
## Warning in if (class(M) == "model") Y = predict(M, data[(1:L), ]) else Y =
## PRED(M, : the condition has length > 1 and only the first element will be
## used
## Warning in if (class(M) == "model") Y = predict(M, data[(1:L), ]) else Y =
## PRED(M, : the condition has length > 1 and only the first element will be
## used
## Joining, by = "variables"
## Warning: Column `variables` joining factor and character vector, coercing
## into character vector
## Joining, by = "variables"
## Warning: Column `variables` joining factor and character vector, coercing
## into character vector
## Joining, by = "variables"
## Warning: Column `variables` joining factor and character vector, coercing
## into character vector
htmltools::tagList(pl$plot)